package com.mathmodeling.entity;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "topic")
public class Topic {
    
    @Id
    @Column(name = "id", length = 36)
    private String id;
    
    @Column(name = "contest_id", length = 36, nullable = false)
    private String contestId;
    
    @Column(name = "name", length = 1, nullable = false)
    private String name;
    
    @Column(name = "`desc`", length = 100)
    private String desc;
    
    @Column(name = "file_path", length = 255, nullable = false)
    private String filePath;
    
    @Column(name = "remark", columnDefinition = "TEXT")
    private String remark;
    
    @Column(name = "created_at")
    private LocalDateTime createdAt;
    
    // 构造函数
    public Topic() {}
    
    public Topic(String id, String contestId, String name, String desc, String filePath) {
        this.id = id;
        this.contestId = contestId;
        this.name = name;
        this.desc = desc;
        this.filePath = filePath;
        this.createdAt = LocalDateTime.now();
    }
    
    // Getter和Setter方法
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getContestId() {
        return contestId;
    }
    
    public void setContestId(String contestId) {
        this.contestId = contestId;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getDesc() {
        return desc;
    }
    
    public void setDesc(String desc) {
        this.desc = desc;
    }
    
    public String getFilePath() {
        return filePath;
    }
    
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }
    
    public String getRemark() {
        return remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
} 